<?php /* Smarty version Smarty-3.1.12, created on 2016-07-11 14:15:57
         compiled from "D:\phpStudy\WWW\demonew\dm\xycms\database.tpl" */ ?>
<?php /*%%SmartyHeaderCode:251475783399d459a59-37172894%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
$_valid = $_smarty_tpl->decodeProperties(array (
  'file_dependency' => 
  array (
    '068981d932bcb1c7b9209359581ce03cfe573298' => 
    array (
      0 => 'D:\\phpStudy\\WWW\\demonew\\dm\\xycms\\database.tpl',
      1 => 1466038899,
      2 => 'file',
    ),
  ),
  'nocache_hash' => '251475783399d459a59-37172894',
  'function' => 
  array (
  ),
  'variables' => 
  array (
    'page_charset' => 0,
    'copyright_author' => 0,
    'action' => 0,
    'tabledb' => 0,
    'volist' => 0,
    'dbnum' => 0,
    'dbsize' => 0,
    'maxfilesize' => 0,
    'backup_info' => 0,
    'filedb' => 0,
    'i' => 0,
    'import_info' => 0,
  ),
  'has_nocache_code' => false,
  'version' => 'Smarty-3.1.12',
  'unifunc' => 'content_5783399d57b281_09240420',
),false); /*/%%SmartyHeaderCode%%*/?>
<?php if ($_valid && !is_callable('content_5783399d57b281_09240420')) {function content_5783399d57b281_09240420($_smarty_tpl) {?><?php if (!is_callable('smarty_modifier_date_format')) include 'D:\\phpStudy\\WWW\\demonew\\source\\core\\plugins\\modifier.date_format.php';
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo $_smarty_tpl->tpl_vars['page_charset']->value;?>
" />
<title>数据库管理</title>
<meta name="author" content="<?php echo $_smarty_tpl->tpl_vars['copyright_author']->value;?>
" />
<link type="text/css" rel="stylesheet" href="xycms/css/admin.css" media="screen" />
<script type='text/javascript' src='js/jquery-1.8.3.min.js'></script>
<script type='text/javascript' src='js/command.js'></script>
<script type="text/javascript" src='../data/editor/kindeditor.js'></script>
</head>
<body>
<?php if ($_smarty_tpl->tpl_vars['action']->value==''){?>
<div class="main-wrap">
  <div class="path"><p>当前位置：其他扩展<span>&gt;</span>数据库管理</p></div>
  <div class="main-cont">
    <h3 class="title"><a href="xycms_database.php?action=restore" class="btn-general">数据恢复</a>数据备份</h3>
	<div class="search-area ">
	  <div class="item">
		您可以根据自己的需要选择需要备份的数据库表，导出的数据文件可用“数据恢复”功能；<br />
		为了数据安全，备份文件采用时间戳命名保存，如果备份数据超过设定的大小程序会自动采用分卷备份功能，请耐心等待直到程序提示全部备份完成；<br />
		附件的备份只需手工转移附件目录和文件即可，风格备份也相同；<br />
		<font color="green"><b>温馨提示：如果您的数据比较多，大于备份分卷的5，6倍，请将admin,authgroup和config三个表单独备份，<br />否则数据恢复分卷一时，可能会因这3张表没有数据导致系统出错！</b></font>
	  </div>
	</div>
	<form action="xycms_database.php" method="post" name="myform" id="myform" style="margin:0">
	<input type="hidden" name="action" id="action" value="backup" />
    <table width="100%" border="0" cellpadding="0" cellspacing="0" class="table" align="center">
	  <thead class="tb-tit-bg">
	  <tr>
	    <th width="12%"><div class="th-gap">选择</div></th>
		<th width="12%"><div class="th-gap">ID</div></th>
		<th width="20%"><div class="th-gap">表名称</div></th>
		<th width="10%"><div class="th-gap">表类型</div></th>
		<th width="10%"><div class="th-gap">记录总数</div></th>
		<th width="10%"><div class="th-gap">表大小</div></th>
		<th width="10%"><div class="th-gap">表状态</div></th>
		<th><div class="th-gap">表编码</div></th>
	  </tr>
	  </thead>
	  <tfoot class="tb-foot-bg"></tfoot>
	  <?php  $_smarty_tpl->tpl_vars['volist'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['volist']->_loop = false;
 $_from = $_smarty_tpl->tpl_vars['tabledb']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['volist']->key => $_smarty_tpl->tpl_vars['volist']->value){
$_smarty_tpl->tpl_vars['volist']->_loop = true;
?>
	  <tr onmouseover="overColor(this)" onmouseout="outColor(this)">
	    <td align="center"><input name="tabledb[]" type="checkbox" value="<?php echo $_smarty_tpl->tpl_vars['volist']->value['table'];?>
" onclick="checkItem(this, 'chkAll')" /></td>
		<td align="center"><?php echo $_smarty_tpl->tpl_vars['volist']->value['i'];?>
</td>
		<td align="left"><?php echo $_smarty_tpl->tpl_vars['volist']->value['table'];?>
</td>
		<td align="left"><?php echo $_smarty_tpl->tpl_vars['volist']->value['type'];?>
</td>
		<td align="center"><?php echo $_smarty_tpl->tpl_vars['volist']->value['dbnum'];?>
</td>
		<td align="center"><?php echo $_smarty_tpl->tpl_vars['volist']->value['dbsize'];?>
</td>
		<td align="center"><?php echo $_smarty_tpl->tpl_vars['volist']->value['status'];?>
</td>
		<td><?php echo $_smarty_tpl->tpl_vars['volist']->value['charset'];?>
</td>
	  </tr>
	  <?php }
if (!$_smarty_tpl->tpl_vars['volist']->_loop) {
?>
      <tr>
	    <td colspan="8" align="center">对不起，没有匹配的数据表！</td>
	  </tr>
	  <?php } ?>
	  <tr>
		<td align="center"><input name="chkAll" type="checkbox" id="chkAll" onclick="checkAll(this, 'tabledb[]')" value="checkbox" />全选</td>
		<td class="hback" colspan="7">共<b><?php echo $_smarty_tpl->tpl_vars['dbnum']->value;?>
</b>张表，数据库大小为：<?php echo $_smarty_tpl->tpl_vars['dbsize']->value;?>
</td>
	  </tr>
	  <tr>
	    <td align="center"><b>分卷备份-&gt;&gt;</b></td>
		<td class="hback" colspan="7">每个分卷文件大小为：<input type="text" name="sizelimit" value="<?php echo $_smarty_tpl->tpl_vars['maxfilesize']->value;?>
" class="input-s" />KB (分卷最小值为200K)&nbsp;&nbsp;
		<font color="#999999">(您的分卷最大值不能超过 <?php echo $_smarty_tpl->tpl_vars['maxfilesize']->value;?>
 KB)</font>
		
		<br /><input class="button" name="btn_del" type="button" value="提交备份" onclick="{if(confirm('确定要提交选择的数据表吗？')){$('#action').val('backup');$('#myform').submit();return true;}return false;}" class="button" /></td>
	  </tr>
	</table>
	</form>
  </div>
</div>
<?php }?>

<?php if ($_smarty_tpl->tpl_vars['action']->value=="backup"){?>
<div class="main-wrap">
  <div class="path"><p>当前位置：其他扩展<span>&gt;</span>数据库管理</p></div>
  <div class="main-cont">
	<h3 class="title"><a href="xycms_database.php?action=restore" class="btn-general">数据恢复</a>数据备份</h3>
	<div class="search-area ">
	  <div class="item">
	  <?php echo $_smarty_tpl->tpl_vars['backup_info']->value;?>

	  </div>
	</div>
  </div>
  <div style="clear:both;"></div>
</div>
<?php }?>

<?php if ($_smarty_tpl->tpl_vars['action']->value=="restore"){?>
<div class="main-wrap">
  <div class="path"><p>当前位置：其他扩展<span>&gt;</span>数据库管理</p></div>
  <div class="main-cont">
    <h3 class="title"><a href="xycms_database.php" class="btn-general">数据备份</a>数据恢复</h3>
	<div class="search-area ">
	  <div class="item">
		本功能在恢复备份数据的同时，将覆盖原有数据，请确定是否需要恢复，以免造成数据损失；<br />
		数据恢复功能只能恢复由当前版本导出的数据文件，其他软件导出格式可能无法识别；<br />
		如果备份文件太大需要一些时间导入，请耐心等待直到程序提示全部导入完成；<br />
		<font color="green"><b>如果一个备份文件有多个分卷，您只需任选一个备份文件导入，程序会自动导入其他分卷。</b></font>
	  </div>
	</div>
    <table width="100%" border="0" cellpadding="0" cellspacing="0" class="table" align="center">
	  <thead class="tb-tit-bg">
	  <tr>
		<th width="10%"><div class="th-gap">ID</div></th>
		<th><div class="th-gap">备份文件</div></th>
		<th width="8%"><div class="th-gap">卷号</div></th>
		<th width="18%"><div class="th-gap">备份时间</div></th>
		<th width="10%"><div class="th-gap">文件大小</div></th>
		<th width="12%"><div class="th-gap">文件类型</div></th>
		<th width="15%"><div class="th-gap">操作</div></th>

	  </tr>
	  </thead>
	  <tfoot class="tb-foot-bg"></tfoot>
	  <?php $_smarty_tpl->tpl_vars['i'] = new Smarty_variable("1", null, 0);?>
	  <?php  $_smarty_tpl->tpl_vars['volist'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['volist']->_loop = false;
 $_from = $_smarty_tpl->tpl_vars['filedb']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['volist']->key => $_smarty_tpl->tpl_vars['volist']->value){
$_smarty_tpl->tpl_vars['volist']->_loop = true;
?>
	  <tr onmouseover="overColor(this)" onmouseout="outColor(this)">
		<td align="center"><?php echo $_smarty_tpl->tpl_vars['i']->value;?>
</td>
		<td align="left"><a href="../data/sqlbackup/<?php echo $_smarty_tpl->tpl_vars['volist']->value['filename'];?>
" target="_blank"><?php echo $_smarty_tpl->tpl_vars['volist']->value['filename'];?>
</a></td>
		<td align="center"><?php echo $_smarty_tpl->tpl_vars['volist']->value['num'];?>
</td>
		<td align="center"><?php echo smarty_modifier_date_format($_smarty_tpl->tpl_vars['volist']->value['timeline'],"%Y-%m-%d %H:%M:%S");?>
</td>
		<td align="center"><?php echo $_smarty_tpl->tpl_vars['volist']->value['size'];?>
</td>
		<td align="center"><?php echo $_smarty_tpl->tpl_vars['volist']->value['type'];?>
</td>
		<td align="center"><a href="xycms_database.php?action=import&sqlfile=<?php echo $_smarty_tpl->tpl_vars['volist']->value['pre'];?>
"  onclick="{if(confirm('恢复功能将覆盖原来的数据，您确认要导入选中的备份数据吗？')){return true;} return false;}" class="icon-edit">恢复</a>&nbsp;&nbsp;<a href="xycms_database.php?action=del&sqlfile=<?php echo $_smarty_tpl->tpl_vars['volist']->value['filename'];?>
" onClick="{if(confirm('此功能不可恢复,您确认要删除选中的备份文件！')){return true;} return false;}" class="icon-del">删除</a></td>
	  </tr>
	  <?php $_smarty_tpl->tpl_vars['i'] = new Smarty_variable($_smarty_tpl->tpl_vars['i']->value+1, null, 0);?>
	  <?php }
if (!$_smarty_tpl->tpl_vars['volist']->_loop) {
?>
      <tr>
	    <td colspan="7" align="center">对不起，暂无SQL备份文件！</td>
	  </tr>
	  <?php } ?>
	</table>
  </div>
</div>
<?php }?>

<?php if ($_smarty_tpl->tpl_vars['action']->value=="import"){?>
<div class="main-wrap">
  <div class="path"><p>当前位置：其他扩展<span>&gt;&gt;</span>数据库管理</p></div>
  <div class="main-cont">
	<h3 class="title"><a href="xycms_database.php?action=backup" class="btn-general"><span>数据备份</span></a>数据恢复</h3>
	<div class="search-area ">
	  <div class="item">
	  <?php echo $_smarty_tpl->tpl_vars['import_info']->value;?>

	  </div>
	</div>
  </div>
  <div style="clear:both;"></div>
</div>
<?php }?>

</body>
</html><?php }} ?>